<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">
	<a4j:outputPanel ajaxRendered="true">
		<h:form>
			<rich:panel styleClass="rich-stglpanel-body">
				<f:facet name="header">#{messages['label.eventos']}</f:facet>
				<s:decorate template="/layout/edit.xhtml">
					<ui:define name="label">#{messages['label.grupo']}</ui:define>
					<h:selectOneMenu 
						value="#{eventoAction.entity.grupo}" 
						required="true"
						label="#{messages['label.grupo']}"
						style="width:300px;">
						<s:selectItems 
							var="_grupoEvento" 
							value="#{grupoEventoAction.resultList}" 
							label="#{_grupoEvento.descricao}"
							itemValue="#{_grupoEvento}"
							noSelectionLabel="#{messages['label.selecione']}"/>
							<f:converter converterId="br.com.o2solutions.siso.webapp.converter.EntidadeBaseConverter"/>
					</h:selectOneMenu>
					<rich:spacer width="5"/>
					<a4j:commandButton 
						image="/img/include.png"
						alt="#{messages['label.incluir.grupo.evento']}"
						title="#{messages['messages.incluir.grupo.evento']}"
						ajaxSingle="true"
						id="grupoEventoModalLink">
						<rich:componentControl for="grupoEventoModalId" attachTo="grupoEventoModalLink" operation="show" event="onclick"/>
					</a4j:commandButton>
				</s:decorate>
				<s:decorate template="/layout/edit.xhtml">
					<ui:define name="label">#{messages['label.descricao']}</ui:define>
					<h:inputText 
						value="#{eventoAction.entity.descricao}" 
						label="#{messages['label.descricao']}" 
						required="true"
						size="70" 
						onkeyup="toUpperCase(this,'')">
					</h:inputText>
				</s:decorate>
			</rich:panel>
			<div>
				<a4j:commandButton 
					value="#{messages['label.salvar']}" 
					action="#{eventoAction.save}"
					rendered="#{eventoAction.entity.id == null}"/>
					
				<a4j:commandButton 
					value="#{messages['label.atualizar']}" 
					action="#{eventoAction.update}"
					rendered="#{eventoAction.entity.id != null}"/>
					
				<a4j:commandButton 
					value="#{messages['label.remover']}" 
					action="#{eventoAction.remove}"
					rendered="#{eventoAction.entity.id != null}"/>
					
				<s:button 
					propagation="none" 
					action="#" 
					value="#{messages['label.limpar']}">
				</s:button>
			</div>
		</h:form>
	</a4j:outputPanel>
</ui:fragment>
